/*
 * c_tabla.h
 *
 *  Created on: 27 Apr 2010
 *      Author: osky
 */

#ifndef C_TABLA_H_
#define C_TABLA_H_

#include <stdio.h>
#include "../CapaFisica/c_bloque.h"

class c_tabla
    {
    private:

    int bits_validos;
    c_bloque buffer_tabla [BLOQUES_TABLA];
    int nro_buffer_en_memoria;


             unsigned int get_pos (unsigned int pos);
             int set_pos (unsigned int pos, unsigned int valor);             
             int copiar_pos (unsigned int pos_origen, unsigned int pos_destino);
	     int incrementar_bits_validos ();


    public:


        c_tabla();

	unsigned int obtener_nro_bucket(unsigned int clave);
        int actualizar_por_split ( unsigned int clave, unsigned int bucket_nuevo, int bit_split);

	int set_pos (unsigned int desde, unsigned int hasta, unsigned int valor);

        unsigned int largo_tabla();
	unsigned int elementos_tabla();
	unsigned int total_reg();

        int save();
        int load();
        int dump(FILE* handler);
    

};




#endif /* C_TABLA_H_ */
